package com.zhiyou100.blog.service;

import com.zhiyou100.blog.dao.EndorseDao;
import com.zhiyou100.blog.dao.impl.EndorseDaoImpl;
import com.zhiyou100.blog.entity.Endorse;

import java.util.List;

/**
 * @author shkstart
 * @create 2021-10-26 11:26
 */
public class EndorseService {
    private EndorseDao dao = new EndorseDaoImpl();

    //根据指定用户名查询 是否给给文章点赞
    public long getEndorseUserZanXuCount(int mid, int uid, boolean isAgree) {
        return dao.getEndorseUserZanXuCount(mid, uid, isAgree);
    }

    //查询该留言的点赞和虚的信息
    public List<Endorse> getListEndorseZanXu(int mid, boolean isAgree) {
        return dao.getListEndorseZanXu(mid, isAgree);
    }


    //修改赞虚
    public int updateEndorseZanXu(int mid, int uid, boolean isAgree) {
        return dao.updateEndorseZanXu(mid, uid, isAgree);
    }

    public List<Endorse> getListEndorseZanXuUid(int uid, boolean isAgree) {
        return dao.getListEndorseZanXuUid(uid, isAgree);
    }

    //插入
    public int addEndorseZanXu(int mid, int uid, boolean isAgree) {
        return dao.addEndorseZanXu(mid, uid, isAgree);
    }
}
